
 <!DOCTYPE HTML>
<html lang="zh-Hans">
<head>
  <meta charset="UTF-8">
  
    <title>搭建Hexo | 哆啦A梦BLOG</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
    
    <meta name="author" content="大雄の梦">
    

    
    <meta name="description" content="每个程序猿都应该有一个属于自己的写作（zhuang bi）博客！在很早的时候，我就想拥有一个博客，这段时间也折腾的七七八八了吧。分享一下自己折腾的过程！ 在折腾这个博客之前，应该对github有所了解，方便我们之后的操作 所需工具：进入官网下载我们需要的两个工具             node.js    如图：node.js点击红框下载        安装完node.js在Custom Set">
<meta name="keywords" content="Hexo">
<meta property="og:type" content="article">
<meta property="og:title" content="搭建Hexo">
<meta property="og:url" content="https://hdiebk.github.io/2018/04/29/hexo-Neo/index.html">
<meta property="og:site_name" content="哆啦A梦BLOG">
<meta property="og:description" content="每个程序猿都应该有一个属于自己的写作（zhuang bi）博客！在很早的时候，我就想拥有一个博客，这段时间也折腾的七七八八了吧。分享一下自己折腾的过程！ 在折腾这个博客之前，应该对github有所了解，方便我们之后的操作 所需工具：进入官网下载我们需要的两个工具             node.js    如图：node.js点击红框下载        安装完node.js在Custom Set">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://t1.aixinxi.net/o_1cer22v9c4kd14bt1a2a4vo1otia.jpg-w.jpg">
<meta property="og:image" content="http://t1.aixinxi.net/o_1cer21q9t1v3h1nu11gbjtpk1prca.jpg-w.jpg">
<meta property="og:image" content="http://t1.aixinxi.net/o_1cer73pp4e4olukosh116l1rf4a.jpg-w.jpg">
<meta property="og:image" content="http://t1.aixinxi.net/o_1cere14j21n5914m316u7jojkbca.jpg-w.jpg">
<meta property="og:image" content="http://t1.aixinxi.net/o_1cereeikl17ie15h11pa9fem1veha.jpg-w.jpg">
<meta property="og:image" content="http://t1.aixinxi.net/o_1cerciq2kru0dg1njcbq61dpla.jpg-w.jpg">
<meta property="og:image" content="http://t1.aixinxi.net/o_1cerd2ni613el1oam512vr8spia.jpg-w.jpg">
<meta property="og:image" content="http://t1.aixinxi.net/o_1cerd5rkdtd3m5h1mjd74hhnfa.jpg-w.jpg">
<meta property="og:image" content="http://t1.aixinxi.net/o_1cerhij0k150q18io11v73n382a.jpg-w.jpg">
<meta property="og:updated_time" content="2018-07-24T09:58:23.995Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="搭建Hexo">
<meta name="twitter:description" content="每个程序猿都应该有一个属于自己的写作（zhuang bi）博客！在很早的时候，我就想拥有一个博客，这段时间也折腾的七七八八了吧。分享一下自己折腾的过程！ 在折腾这个博客之前，应该对github有所了解，方便我们之后的操作 所需工具：进入官网下载我们需要的两个工具             node.js    如图：node.js点击红框下载        安装完node.js在Custom Set">
<meta name="twitter:image" content="http://t1.aixinxi.net/o_1cer22v9c4kd14bt1a2a4vo1otia.jpg-w.jpg">

    
    <link rel="alternative" href="/atom.xml" title="哆啦A梦BLOG" type="application/atom+xml">
    
    
    <link rel="icon" href="/img/favicon.ico">
    
    
    <link rel="apple-touch-icon" href="/img/logoA.png">
    <link rel="apple-touch-icon-precomposed" href="/img/logoA.png">
    
    <link rel="stylesheet" href="/css/style.css">
</head>

  <body>
    <header>
      
<div>
		
			<div id="imglogo">
				<a href="/"><img src="/img/logoA.png" alt="哆啦A梦BLOG" title="哆啦A梦BLOG"/></a>
			</div>
			
			<div id="textlogo">
				<h1 class="site-name"><a href="/" title="哆啦A梦BLOG">哆啦A梦BLOG</a></h1>
				<h2 class="blog-motto">在有生之年，努力去做好自己喜爱的事情。</h2>
			</div>
			<div class="navbar"><a class="navbutton navmobile" href="#" title="Menu">
			</a></div>
			<nav class="animated">
				<ul>
					<ul>
					 
						<li><a href="/">首页（Home）</a></li>
					
						<li><a href="/archives">归档（archives）</a></li>
					
						<li><a href="/tags">标签（tags）</a></li>
					
						<li><a href="/about">关于（about）</a></li>
					
					<li>
 					
					<form class="search" action="//google.com/search" method="get" accept-charset="utf-8">
						<label>Search</label>
						<input type="search" id="search" name="q" autocomplete="off" maxlength="20" placeholder="Search" />
						<input type="hidden" name="q" value="site:hdiebk.github.io">
					</form>
					
					</li>
				</ul>
			</nav>			
</div>
    </header>
    <div id="container">
      <div id="main" class="post" itemscope itemprop="blogPost">
  
    <article itemprop="articleBody">
        <header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/2018/04/29/hexo-Neo/" title="搭建Hexo" itemprop="url">搭建Hexo</a>
  </h1>
  <p class="article-author">By
       
		<a href="/about" title="大雄の梦" target="_blank" itemprop="author">大雄の梦</a>
		
  <p class="article-time">
    <time datetime="2018-04-29T14:22:05.039Z" itemprop="datePublished"> Published 2018-04-29</time>

<span id="busuanzi_container_page_pv">
    总阅读<span id="busuanzi_value_page_pv"></span>次
</span>
  </p>
</header>

    <div class="article-content">

        

        
        <div id="toc" class="toc-article">
            <strong class="toc-title">Contents</strong>
        
            <ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#undefined"><span class="toc-number">1.</span> <span class="toc-text">所需工具：</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#undefined"><span class="toc-number">1.1.</span> <span class="toc-text">安装完node.js</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#undefined"><span class="toc-number">1.2.</span> <span class="toc-text">安装完Git，打开Gitbash，键入如下命令：git version(查看版本)</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#undefined"><span class="toc-number">2.</span> <span class="toc-text">*注册Github账号基友网</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#undefined"><span class="toc-number">3.</span> <span class="toc-text">注册完成创建仓库</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#undefined"><span class="toc-number">4.</span> <span class="toc-text">*配置shh</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#undefined"><span class="toc-number">5.</span> <span class="toc-text">安装hexo</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#undefined"><span class="toc-number">6.</span> <span class="toc-text">hexo将至</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#undefined"><span class="toc-number">7.</span> <span class="toc-text">上传GitHub</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#undefined"><span class="toc-number">8.</span> <span class="toc-text">部署hexo</span></a></li></ol>
        
        </div>
        
        <p>每个程序猿都应该有一个属于自己的写作（zhuang bi）博客！在很早的时候，我就想拥有一个博客，这段时间也折腾的七七八八了吧。分享一下自己折腾的过程！</p>
<p><hr><br>在折腾这个博客之前，应该对github有所了解，方便我们之后的操作</p>
<p></p><h3>所需工具：</h3><br>进入官网下载我们需要的两个工具<p></p>
<p><ol><br>    <a href="https://nodejs.org/en/" title="node.js官网" target="_blank" rel="noopener"><br>        <li>node.js</li><br>    </a>如图：node.js点击红框下载<br>    <img src="http://t1.aixinxi.net/o_1cer22v9c4kd14bt1a2a4vo1otia.jpg-w.jpg" alt=""><br>    <h4>安装完node.js</h4><em>在Custom Setup这步选择 Add to PATH 这样他自己就帮你配置环境变量了，然后在桌面按 win+r输入cmd并打开，输入path，查看配置环境是否配置成功。接下来查看版本号命令：<code>node -v</code><p>下载完成，照常安装即可。其中node.js官方文档推荐的安装方式是用<a href="https://github.com/creationix/nvm" title="" target="_blank" rel="noopener">nvm</a>&nbsp;个人并不推荐这样的安装方式，因为这样的安装方式需要对Github有一定的了解及操作这里不对nvm安装方法进行详解，可自行了解！</p><br>    <a href="https://git-scm.com/" title="git官网" target="_blank" rel="noopener"><br>        <li>git</li><br>    </a>如图：Git下载<br>    <img src="http://t1.aixinxi.net/o_1cer21q9t1v3h1nu11gbjtpk1prca.jpg-w.jpg" alt=""><br>    安装完Git，打开Gitbash，键入如下命令：git -v 查看版本号<small style="color: #919191"></small></em>有空格<br></ol></p>
<p></p><h4>安装完Git，打开Gitbash，键入如下命令：<code>git version</code>(查看版本)</h4><br>完成上述两个工具，我们即可动手安装主角“hexo”。<p></p>
<p>我们使用npm进行安装 键入如下代码：&lt;<code>$ npm install -g hexo-cli</code><br><span style="color: #919191">如果下载速度比较慢的话，可以用国内淘宝镜像&nbsp;键入如下代码：<code>$ npm config set registry”<a href="https://registry.npm.taobao.org&quot;" target="_blank" rel="noopener">https://registry.npm.taobao.org&quot;</a></code><br></span><br>&nbsp;&nbsp;这段代码是把npm默认的源设置成淘宝镜像站的。</p>
<p></p><h3>*注册Github账号<s style="color: #919191"><small>基友网</small></s></h3><p></p>
<p><ul><br>    <li><a href="https://github.com/" target="_blank" rel="noopener">前往GitHub官网<small style="color: #919191">如图所示，进行注册or登录</small><br>            <img src="http://t1.aixinxi.net/o_1cer73pp4e4olukosh116l1rf4a.jpg-w.jpg" alt=""><br>        </a><br>    </li><br></ul></p>
<p></p><h3>注册完成创建仓库</h3><p></p>
<p><ul><br>    <li>仓库名称为你注册时的用户名 例如我的<a href="https://github.com/hdiebk/hdiebk.github.io" target="_blank" rel="noopener">hdiebk.github.io</a><br>    </li><li>如图创建：</li><br>    <img src="http://t1.aixinxi.net/o_1cere14j21n5914m316u7jojkbca.jpg-w.jpg" alt=""><img src="http://t1.aixinxi.net/o_1cereeikl17ie15h11pa9fem1veha.jpg-w.jpg" alt="">第二个框是描述，可填可不填。<br>    后面配置账号信息，填的就是这个名称。<br></ul></p>
<p></p><h3>*配置shh</h3><br>在电脑磁盘创建一个文件夹存放blog，可以是任意名称（有意义的名称最好，方便后面自己查看）然后右键找到<strong>git bash here</strong>并打开<p></p>
<p><ul><br>    <li>输入<code>ssh-keygen -t rsa -C </code>“你注册的邮箱” 并回车，会让你输入GitHub账号及密码</li><small style="color: #919191">当时忘了截图，大家注意看控制台就好</small><br>    出现c盘地址，根据这个地址我们到c盘中找到该文件<img src="http://t1.aixinxi.net/o_1cerciq2kru0dg1njcbq61dpla.jpg-w.jpg" alt="">其中id_rsa是私有密钥（不要透露），id_rsa.pub是公共密钥<br>    <li>然后打开公共密钥，复制下里面所有内容，登陆进去你的Github</li><br>    <img src="http://t1.aixinxi.net/o_1cerd2ni613el1oam512vr8spia.jpg-w.jpg" alt=""><img src="http://t1.aixinxi.net/o_1cerd5rkdtd3m5h1mjd74hhnfa.jpg-w.jpg" alt="">点击右上角的头像，找到图中对应的结果，点击右上角 New SSH Key按钮，Title随便填，key填入之前复制的内容即可。<br>    <li>最后一步</li>测试是否配对成功，在<strong>git bash here</strong>键入：<code>ssh -T <a href="mailto:git@github.com" target="_blank" rel="noopener">git@github.com</a></code>，会询问是否继续链接，输入yes即可。配置完成！<br></ul></p>
<p></p><h3>安装hexo</h3><p></p>
<p><ul><br>    <li>执行命令进行安装</li><br>    <small>一条一条来</small><br><code>npm install hexo-cli g<br>hexo init blog<br>cd blog<br>npm install<br>npm install hexo-server –save<br>npm install hexo-admin –save<br>npm install hexo-generator-archive –save<br>npm install hexo-generator-feed –save<br>npm install hexo-generator-search –save<br>npm install hexo-generator-tag –save<br>npm install hexo-deployer-git –save<br>npm install hexo-generator-sitemap –save<br></code><br></ul></p>
<p></p><h3>hexo将至</h3><p></p>
<p><ul><br>    <li>在本地服务器中使用</li><br>    <small>键入如下命令：</small><br>    <code>hexo generate</code><br>    <code>hexo s</code><br>    <li>此时打开浏览器，输入：<a href="http://localhost:4000/" target="_blank" rel="noopener">http://localhost:4000/</a>就可以看到一个静态网页呈现在你面前</li><br>    <small>如果输入<a href="http://localhost:4000/浏览器出错，则是端口对占用的缘故。此时我们在" target="_blank" rel="noopener">http://localhost:4000/浏览器出错，则是端口对占用的缘故。此时我们在</a><strong>git bash here</strong>Ctrl+c中断链接，然后我们需要在<strong>git bash here</strong>键入：hexo s -p 5000</small>更改端口地址。更改好以后输入：<a href="http://localhost:5000/" target="_blank" rel="noopener">http://localhost:5000/。<br></a></ul></p>
<p></p><h3>上传GitHub</h3><p></p>
<p><ul><br>    <li>修改配置文件</li><br>    在之前创建好的本地文件夹中，找到文件夹下/_config.yml，修改deploy内容的红框中的三个参数<br>    <img src="http://t1.aixinxi.net/o_1cerhij0k150q18io11v73n382a.jpg-w.jpg" alt=""><small>第二个框中修改为自己的用户名</small><br></ul></p>
<p></p><h3>部署hexo</h3><p></p>
<p><ul><br>    <li>输入命令</li><br>    <code>hexo clean<br>hexo generate<br>hexo deploy</code><br>可缩写为<code>hexo g：hexo generate<br>hexo c：hexo clean<br>hexo s：hexo server<br>hexo d：hexo deploy</code>或者缩写为<code>hexo g -s</code><code>hexo g -d</code><br></ul><br>这时候我们在浏览器里，输入：https://你的用户.github.io/例如我的：<a href="https://hdiebk.github.io/">https://hdiebk.github.io/</a></p>
<p>到这一步我们就大功告成了，接下来我还会继续讲述我的hexo折腾之路。</p>


        
    </div>
        <footer class="article-footer clearfix">
<div class="article-catetags">


  <div class="article-tags">
  
  <span></span> <a href="/tags/Hexo/">Hexo</a>
  </div>

</div>



	<div class="article-share" id="share">
	
	  <div data-url="https://hdiebk.github.io/2018/04/29/hexo-Neo/" data-title="搭建Hexo | 哆啦A梦BLOG" data-tsina="2915578625" class="share clearfix">
	  </div>
	
	</div>


</footer>


    </article>
    
<nav class="article-nav clearfix">
 
 <div class="prev" >
 <a href="/2018/05/25/blog1/" title="前端学习-HTML">
  <strong>上一篇：</strong><br/>
  <span>
  前端学习-HTML</span>
</a>
</div>


</nav>

    



</div>

      <div class="openaside"><a class="navbutton" href="#" title="Show Sidebar"></a></div>

  <div id="toc" class="toc-aside">
  <strong class="toc-title">Contents</strong>
 
 <ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#undefined"><span class="toc-number">1.</span> <span class="toc-text">所需工具：</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#undefined"><span class="toc-number">1.1.</span> <span class="toc-text">安装完node.js</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#undefined"><span class="toc-number">1.2.</span> <span class="toc-text">安装完Git，打开Gitbash，键入如下命令：git version(查看版本)</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#undefined"><span class="toc-number">2.</span> <span class="toc-text">*注册Github账号基友网</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#undefined"><span class="toc-number">3.</span> <span class="toc-text">注册完成创建仓库</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#undefined"><span class="toc-number">4.</span> <span class="toc-text">*配置shh</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#undefined"><span class="toc-number">5.</span> <span class="toc-text">安装hexo</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#undefined"><span class="toc-number">6.</span> <span class="toc-text">hexo将至</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#undefined"><span class="toc-number">7.</span> <span class="toc-text">上传GitHub</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#undefined"><span class="toc-number">8.</span> <span class="toc-text">部署hexo</span></a></li></ol>
 
  </div>

<div id="asidepart">
<div class="closeaside"><a class="closebutton" href="#" title="Hide Sidebar"></a></div>
<aside class="clearfix">

  

  
<div class="tagslist">
	<p class="asidetitle">Tags</p>
		<ul class="clearfix">
		
			
				<li><a href="/tags/前端/" title="前端">前端<sup>3</sup></a></li>
			
		
			
				<li><a href="/tags/Hexo/" title="Hexo">Hexo<sup>1</sup></a></li>
			
		
			
		
		</ul>
</div>


  <div class="rsspart">
	<a href="/atom.xml" target="_blank" title="rss">RSS</a>
</div>

  

</aside>
</div>
    </div>
    <footer><div id="footer" >
	
	<div class="line">
		<span></span>
		<div class="author"></div>
	</div>
	
	
	<section class="info">
		<p> 用技术链接世界尽头. <br/>
			This is my blog,believe it or not.</p>
	</section>
	 
	<div class="social-font" class="clearfix">
		
		<a href="http://weibo.com/2915578625" target="_blank" class="icon-weibo" title="微博"></a>
		
		
		<a href="https://github.com/https://github.com/hdiebk" target="_blank" class="icon-github" title="github"></a>
		
		
		
		
		
		
		
		<a href="http://www.zhihu.com/people/hdiebk" target="_blank" class="icon-zhihu" title="知乎"></a>
		
		
		
		<a href="mailto:2510129345@qq.com" target="_blank" class="icon-email" title="Email Me"></a>
		
	</div>
			
		

		<p class="copyright">
		Powered by <a href="http://hexo.io" target="_blank" title="hexo">DLAM</a> and Theme by <a href="https://github.com/hdiebk" target="_blank" title="Hdiebk">Hdiebk</a> © 2018
		
		<a href="/about" target="_blank" title="大雄の梦">大雄の梦</a>
		<br>
		<span id="timeDate">载入天数...</span><span id="times">载入时分秒...</span>
 	 <script>
 			 var now = new Date();
 			 function createtime() {
 					 var grt= new Date("04/20/2018 00:00:00");//此处修改你的建站时间或者网站上线时间
 					 now.setTime(now.getTime()+250);
 					 days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days);
 					 hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours);
 					 if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);
 					 mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;}
 					 seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
 					 snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;}
 					 document.getElementById("timeDate").innerHTML = "本站已安全运行 "+dnum+" 天 ";
 					 document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒";
 			 }
 	 setInterval("createtime()",250);
 	 </script>
		</p>
</div>
<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js">
</script>
<span id="busuanzi_container_site_pv">
    &nbsp;&nbsp;Total visits:&nbsp;<span id="busuanzi_value_site_pv"></span>
</span>
<span id="busuanzi_container_site_uv">
  &nbsp;&nbsp;You are Visiter No.<span id="busuanzi_value_site_uv"></span>
</span>
</footer>
    <script src="/js/jquery-2.0.3.min.js"></script>
<script src="/js/jquery.imagesloaded.min.js"></script>
<script src="/js/gallery.js"></script>
<script src="/js/jquery.qrcode-0.12.0.min.js"></script>

<script type="text/javascript">
$(document).ready(function(){ 
  $('.navbar').click(function(){
    $('header nav').toggleClass('shownav');
  });
  var myWidth = 0;
  function getSize(){
    if( typeof( window.innerWidth ) == 'number' ) {
      myWidth = window.innerWidth;
    } else if( document.documentElement && document.documentElement.clientWidth) {
      myWidth = document.documentElement.clientWidth;
    };
  };
  var m = $('#main'),
      a = $('#asidepart'),
      c = $('.closeaside'),
      o = $('.openaside');
  c.click(function(){
    a.addClass('fadeOut').css('display', 'none');
    o.css('display', 'block').addClass('fadeIn');
    $('#toc.toc-aside').css('display','block').addClass('fadeIn');
    m.addClass('moveMain');
  });
  o.click(function(){
    o.css('display', 'none').removeClass('beforeFadeIn');
    a.css('display', 'block').removeClass('fadeOut').addClass('fadeIn');      
    m.removeClass('moveMain');
  });
  $(window).scroll(function(){
    o.css("top",Math.max(80,260-$(this).scrollTop()));
  });
  
        getSize();
        if (myWidth >= 1024) {
          c.click();
        }
  
  $(window).resize(function(){
    getSize(); 
    if (myWidth >= 1024) {
      $('header nav').removeClass('shownav');
    }else{
      m.removeClass('moveMain');
      a.css('display', 'block').removeClass('fadeOut');
      o.css('display', 'none');
      
      $('#toc.toc-aside').css('display', 'none');
        
    }
  });
});
</script>

<script type="text/javascript">
$(document).ready(function(){ 
  var ai = $('.article-content>iframe'),
      ae = $('.article-content>embed'),
      t  = $('#toc'),
      ta = $('#toc.toc-aside'),
      o  = $('.openaside'),
      c  = $('.closeaside');
  if(ai.length>0){
    ai.wrap('<div class="video-container" />');
  };
  if(ae.length>0){
   ae.wrap('<div class="video-container" />');
  };
  c.click(function(){
    ta.css('display', 'block').addClass('fadeIn');
  });
  o.click(function(){
    ta.css('display', 'none');
  });
  $(window).scroll(function(){
    ta.css("top",Math.max(140,320-$(this).scrollTop()));
  });
});
</script>


<script type="text/javascript">
$(document).ready(function(){ 
  var $this = $('.share'),
      url = $this.attr('data-url'),
      encodedUrl = encodeURIComponent(url),
      title = $this.attr('data-title'),
      tsina = $this.attr('data-tsina'),
      description = $this.attr('description');
  var html = [
  '<div class="hoverqrcode clearfix"></div>',
  '<a class="overlay" id="qrcode"></a>',
  '<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="article-share-facebook" target="_blank" title="Facebook"></a>',
  '<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="article-share-twitter" target="_blank" title="Twitter"></a>',
  '<a href="#qrcode" class="article-share-qrcode" title="微信"></a>',
  '<a href="http://widget.renren.com/dialog/share?resourceUrl=' + encodedUrl + '&srcUrl=' + encodedUrl + '&title=' + title +'" class="article-share-renren" target="_blank" title="人人"></a>',
  '<a href="http://service.weibo.com/share/share.php?title='+title+'&url='+encodedUrl +'&ralateUid='+ tsina +'&searchPic=true&style=number' +'" class="article-share-weibo" target="_blank" title="微博"></a>',
  '<span title="Share to"></span>'
  ].join('');
  $this.append(html);

  $('.hoverqrcode').hide();

  var myWidth = 0;
  function updatehoverqrcode(){
    if( typeof( window.innerWidth ) == 'number' ) {
      myWidth = window.innerWidth;
    } else if( document.documentElement && document.documentElement.clientWidth) {
      myWidth = document.documentElement.clientWidth;
    };
    var qrsize = myWidth > 1024 ? 200:100;
    var options = {render: 'image', size: qrsize, fill: '#2ca6cb', text: url, radius: 0.5, quiet: 1};
    var p = $('.article-share-qrcode').position();
    $('.hoverqrcode').empty().css('width', qrsize).css('height', qrsize)
                          .css('left', p.left-qrsize/2+20).css('top', p.top-qrsize-10)
                          .qrcode(options);
  };
  $(window).resize(function(){
    $('.hoverqrcode').hide();
  });
  $('.article-share-qrcode').click(function(){
    updatehoverqrcode();
    $('.hoverqrcode').toggle();
  });
  $('.article-share-qrcode').hover(function(){}, function(){
      $('.hoverqrcode').hide();
  });
});   
</script>











<link rel="stylesheet" href="/fancybox/jquery.fancybox.css" media="screen" type="text/css">
<script src="/fancybox/jquery.fancybox.pack.js"></script>
<script type="text/javascript">
$(document).ready(function(){ 
  $('.article-content').each(function(i){
    $(this).find('img').each(function(){
      if ($(this).parent().hasClass('fancybox')) return;
      var alt = this.alt;
      if (alt) $(this).after('<span class="caption">' + alt + '</span>');
      $(this).wrap('<a href="' + this.src + '" title="' + alt + '" class="fancybox"></a>');
    });
    $(this).find('.fancybox').each(function(){
      $(this).attr('rel', 'article' + i);
    });
  });
  if($.fancybox){
    $('.fancybox').fancybox();
  }
}); 
</script>



<!-- Analytics Begin -->



<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?e6d1f421bbc9962127a50488f9ed37d1";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>



<!-- Analytics End -->

<!-- Totop Begin -->

	<div id="totop">
	<a title="Back to Top"><img src="/img/scrollup.png"/></a>
	</div>
	<script src="/js/totop.js"></script>

<!-- Totop End -->

<!-- MathJax Begin -->
<!-- mathjax config similar to math.stackexchange -->


<!-- MathJax End -->

<!-- Tiny_search Begin -->

<!-- Tiny_search End -->

  </body>
</html>
